<?php
include 'db.php';

$stmt = $pdo->prepare("SELECT * FROM call_records");
$stmt->execute();
$callRecords = $stmt->fetchAll(PDO::FETCH_ASSOC);

echo json_encode(['success' => true, 'records' => $callRecords]);